package tests;

import static org.junit.Assert.*;
import logic.PasswordCheck;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class PasswordCheckTest {

	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testCheckPasswordTrue() {
		PasswordCheck passwordCheck = new PasswordCheck();
		assertTrue(passwordCheck.checkPassword("A2R3i$n%"));
		
	}
	@Test
	public void testCheckPasswordFalse() {
		PasswordCheck passwordCheck = new PasswordCheck();
		assertFalse(passwordCheck.checkPassword("adi"));
		
	}

	@Test
	public void testCheckPasswordLenghtTrue() {
		PasswordCheck passwordCheck = new PasswordCheck();
		assertTrue(passwordCheck.checkPasswordLenght(10));
	}
	
	@Test
	public void testCheckPasswordLenghtFalse() {
		PasswordCheck passwordCheck = new PasswordCheck();
		assertFalse(passwordCheck.checkPasswordLenght(2));
	}

	@Test
	public void testCheckTwoUpperCaseCharTrue() {
		PasswordCheck passwordCheck = new PasswordCheck();
		String password = "A2R3i$n%";
		int length = password.length();
		assertTrue(passwordCheck.checkTwoUpperCaseChar(password, length));
	}
	@Test
	public void testCheckTwoUpperCaseCharFalse() {
		PasswordCheck passwordCheck = new PasswordCheck();
		String password = "adidsadsadasas";
		int length = password.length();
		assertFalse(passwordCheck.checkTwoUpperCaseChar(password, length));
	}
	@Test
	public void testCheckTwoLowerCaseCharTrue() {
		PasswordCheck passwordCheck = new PasswordCheck();
		String password = "A2R3i$n%";
		int length = password.length();
		assertTrue(passwordCheck.checkTwoLowerCaseChar(password, length));
	}
	@Test
	public void testCheckTwoLowerCaseCharFalse() {
		PasswordCheck passwordCheck = new PasswordCheck();
		String password = "ADI";
		int length = password.length();
		assertFalse(passwordCheck.checkTwoLowerCaseChar(password, length));
	}
	@Test
	public void testCheckTwoDigitalCharTrue() {
		PasswordCheck passwordCheck = new PasswordCheck();
		String password = "A2R3i$n%";
		int length = password.length();
		assertTrue(passwordCheck.checkTwoDigitalChar(password, length));
	}
	
	@Test
	public void testCheckTwoDigitalCharFalse() {
		PasswordCheck passwordCheck = new PasswordCheck();
		String password = "adi";
		int length = password.length();
		assertFalse(passwordCheck.checkTwoDigitalChar(password, length));
	}

	@Test
	public void testCheckTwoSpecialCharTrue() {
		PasswordCheck passwordCheck = new PasswordCheck();
		String password = "A2R3i$n%";
		int length = password.length();
		assertTrue(passwordCheck.checkTwoSpecialChar(password, length));
	}
	@Test
	public void testCheckTwoSpecialCharFalse() {
		PasswordCheck passwordCheck = new PasswordCheck();
		String password = "adi";
		int length = password.length();
		assertTrue(passwordCheck.checkTwoSpecialChar(password, length));
	}

}
